/////////////////////////////////page_parkCheckCar///////////////////////
$(document).on("pageInit", "#page_parkCheckCar", function(e, pageId, $page) {
    my.givetitle('泊车验证车辆');
	$('.bar').show()
      	    	 key=my.get_key(my.getCookie('token'))
      			//上传图片
      			$('.img-xsz-z').click(function(){
                    var list={"id":".img-xsz-z","text":"行驶证正面"}
                    list=JSON.stringify(list)
                    var proc=function(){
                        showinmage(list);
                    };
                    callwechatselectimg(proc);
      				 /*var list={"id":".img-xsz-z","text":"行驶证正面"}
      			         list=JSON.stringify(list)
      				 ad.native_get_photo(list)*/
      			})
      			$('.img-xsz-f').click(function(){
                    var list={"id":".img-xsz-f","text":"行驶证正面"}
                    list=JSON.stringify(list)
                    var proc=function(){
                        showinmage(list);
                    };
                    callwechatselectimg(proc);
                    /*var list={"id":".img-xsz-z","text"
      				/* var list={"id":".img-xsz-f","text":"行驶证反面"}
      			         list=JSON.stringify(list)
      				 ad.native_get_photo(list)*/
      			})
                $('.commit-state').click(function(){
                	if($(this).is(':checked')){
                		$('[name=commit_state]').val('1')
                	}else{
                		$('[name=commit_state]').val('0')
                	}
                	console.log($('[name=commit_state]').val())
                })
      			//提交
      			$('#zc').click(function(){
                    if( !$('[name=checkCarsubtoaudit]').is(':checked')){
                        $.alert('请确认勾选"立即认证"');
                        return false;
                    };
                    if($('.img-xsz-z').attr('name')=='0'){$.toast('请上传行驶证正本照片'); return false};
                    if($('.img-xsz-f').attr('name')=='0'){$.toast('请上传行驶证副本照片'); return false};
                    var info_parkpay={
                        'carpic1':$('.img-xsz-z').attr('name'),
                        'carpic2':$('.img-xsz-f').attr('name')
                    };
                    info_parkpay=JSON.stringify(info_parkpay);
                    sessionStorage.parkingorderpictemp=info_parkpay;
                    $('.img-xsz-f').attr('name')

                    $.router.load(parkConfirmUrl2,true);

      			    /*$('#zc').addClass('active_btn')
      				$.showPreloader()
      				var info_checkCar={
      						//'u_userid':sessionStorage.id,
      						'car_carid':sessionStorage.usercar_id_parkCheckCar,
      						'u_userid':my.getCookie('id'),
      						'c_number':'',
      						'insurance_num':'',
      						'busin_num':'',
      						'commit_state':$('[name=commit_state]').val(),
      						'veh_first_img':$('.img-xsz-z').attr('name'),
      						'veh_second_img':$('.img-xsz-f').attr('name'),
      						'insurance_img':"",
      						'busin_img':"",
      						'brand_id':'',
      						'brand_name':'',
      						'cars_id':'',
      						'cars_name':'',
      						'models_id':'',
      						'models_name':'',
      				}
      				console.log(info_checkCar)
    					info_checkCar=JSON.stringify(info_checkCar)
                        info_checkCar=my.cryptoASEencrypt(info_checkCar,key)
      				$.ajax({
      						type:"post",
      						url:api.usercarsmanage,
      						data:{
      							'api_value':info_checkCar
      						},
      						async:true,
      						error:function(){
      							$.hidePreloader()
      					       	$('#zc').removeClass('active_btn')
      							$.toast("提交失败，请重试..");
      						},
      						success:function(data){
      							$.hidePreloader()
      					       	$('#zc').removeClass('active_btn')
      							if(data.match("err_code")!=null){
      								$.hideIndicator()
      								switch(JSON.parse(data).err_code)
      								{
      									case 40003:
      									    my.tokenExpire()
      									   break;
      									default:
      									   $.alert(JSON.parse(data).err_msg);
      								}

      							}else{
      								$.alert('您的免费泊车/出租订单已成功，您可在目的地选车租车',function(){
      									 $.router.load(parkRecommendUrl,true);
      								})

      							}
      						},
      				});*/

      			})
})